var fs = require('fs')

function loadImageAsync(url) {
    return new Promise(function (resolve, reject) {
        fs.readFile(url, function (err, res) {
            if (err) {
                console.log(err)
            }
            resolve(res);
        })
    });
}

loadImageAsync('cat.jpg').then(function (ree) {
    console.log(ree)
}).catch(function (err) {
    console.log(err)
});
